package cn.stylefeng.guns.modular.gridsystem.controller;

import cn.stylefeng.guns.core.annotion.BusinessLog;
import cn.stylefeng.guns.core.enums.LogAnnotionOpTypeEnum;
import cn.stylefeng.guns.core.pojo.response.ResponseData;
import cn.stylefeng.guns.core.pojo.response.SuccessResponseData;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import cn.stylefeng.guns.modular.gridsystem.service.BizSoundCardLogService;
import cn.stylefeng.guns.modular.gridsystem.model.param.BizSoundCardLogParam;

import javax.annotation.Resource;

/**
 * 声卡记录日志 控制器
 *
 * @author: ssy
 * @date: 2022/10/24 18:31
 */
@RestController
public class BizSoundCardLogController {

    @Resource
    private BizSoundCardLogService bizSoundCardLogService;

    /**
     * 分页查询声卡记录日志
     *
     * @author ssy
     * @date 2022/10/24 18:31
     */
    @GetMapping("/bizSoundCardLog/page")
    @BusinessLog(title = "声卡记录日志_分页查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData page(BizSoundCardLogParam bizSoundCardLogParam) {
        return new SuccessResponseData(bizSoundCardLogService.page(bizSoundCardLogParam));
    }

    /**
     * 获取全部声卡记录日志
     *
     * @author ssy
     * @date 2022/10/24 18:31
     */
    @GetMapping("/bizSoundCardLog/list")
    @BusinessLog(title = "声卡记录日志_查询所有", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData list(BizSoundCardLogParam bizSoundCardLogParam) {
        return new SuccessResponseData(bizSoundCardLogService.list(bizSoundCardLogParam));
    }

    /**
     * 查看详情声卡记录日志
     *
     * @author ssy
     * @date 2022/10/24 18:31
     */
    @GetMapping("/bizSoundCardLog/detail")
    @BusinessLog(title = "声卡记录日志_查看详情", opType = LogAnnotionOpTypeEnum.DETAIL)
    public ResponseData detail(@Validated(BizSoundCardLogParam.detail.class) BizSoundCardLogParam bizSoundCardLogParam) {
        return new SuccessResponseData(bizSoundCardLogService.detail(bizSoundCardLogParam));
    }

    /**
     * 添加声卡记录日志
     *
     * @author ssy
     * @date 2022/10/24 18:31
     */
    @PostMapping("/bizSoundCardLog/add")
    @BusinessLog(title = "声卡记录日志_增加", opType = LogAnnotionOpTypeEnum.ADD)
    public ResponseData add(@RequestBody @Validated(BizSoundCardLogParam.add.class) BizSoundCardLogParam bizSoundCardLogParam) {
        bizSoundCardLogService.add(bizSoundCardLogParam);
        return new SuccessResponseData();
    }

    /**
     * 删除声卡记录日志
     *
     * @author ssy
     * @date 2022/10/24 18:31
     */
    @PostMapping("/bizSoundCardLog/delete")
    @BusinessLog(title = "声卡记录日志_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    public ResponseData delete(@RequestBody @Validated(BizSoundCardLogParam.delete.class) BizSoundCardLogParam bizSoundCardLogParam) {
        bizSoundCardLogService.delete(bizSoundCardLogParam);
        return new SuccessResponseData();
    }

    /**
     * 编辑声卡记录日志
     *
     * @author ssy
     * @date 2022/10/24 18:31
     */
    @PostMapping("/bizSoundCardLog/edit")
    @BusinessLog(title = "声卡记录日志_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    public ResponseData edit(@RequestBody @Validated(BizSoundCardLogParam.edit.class) BizSoundCardLogParam bizSoundCardLogParam) {
        bizSoundCardLogService.edit(bizSoundCardLogParam);
        return new SuccessResponseData();
    }


}
